import { Random } from 'mockjs'
import { resultSuccess } from '../_util'

const consoleInfo = {
  // 访问量
  visits: {
    dayVisits: Random.integer(10000, 99999),
    dayTB: Random.float(-30, 30, 2, 2),
    weekTB: Random.float(-30, 30, 2, 2),
    amount: Random.integer(99999, 999999),
  },
  // 销售额
  saleroom: {
    weekSaleroom: Random.integer(10000, 99999),
    percent: Random.integer(10, 99),
    amount: Random.integer(99999, 999999),
  },
  // 订单量
  orderLarge: {
    weekLarge: Random.integer(10000, 99999),
    dayTB: Random.float(-30, 30, 2, 2),
    weekTB: Random.float(-30, 30, 2, 2),
    changePercent: Random.float(10, 99, 2, 2),
  },
  // 成交额度
  volume: {
    weekLarge: Random.integer(10000, 99999),
    monthTB: Random.float(-30, 30, 2, 2),
    monthHB: Random.float(-30, 30, 2, 2),
    amount: Random.integer(99999, 999999),
  },
}

export default [
  // 主控台 卡片数据
  {
    url: '/api/dashboard/console',
    timeout: 1000,
    method: 'get',
    response: () => {
      return resultSuccess({
        result: consoleInfo
      })
    },
  },
]
